package org.testis.guiappsmodule.data;

import org.testis.data.TestStepDataObject;


/**
 *
 * @author nurhat
 */
public class GuiAppsModuleDataObject extends TestStepDataObject
{

    private static final long serialVersionUID = 19820012L;
    private String m_script;
    private String m_parameters;
    /**
     * The string to be checked whether output is contains or not
     */
    private String m_containsString;
    /**
     * Expected exit code of terminal application
     */
    private String m_expectedExitCode;
    /**
     * Output created after execution of terminal app
     */
    private String m_outputString;
    /**
     * Error Output created after execution of terminal app
     */
    private String m_errorString;
    /**
     * Exit code of terminal application
     */
    private String m_exitCode;


    public GuiAppsModuleDataObject()
    {
        setErrorString("");
        setExitCode("");
        setExpectedExitCode("");
        setOutputString("");
        setScript("");
        setContainsString("");
        setParameters("");
    }


    public GuiAppsModuleDataObject(TestStepDataObject data)
    {
        super(data);
        setErrorString("");
        setExitCode("");
        setExpectedExitCode("");
        setOutputString("");
        setScript("");
        setContainsString("");
        setParameters("");
    }


    public String getScript()
    {
        return m_script;
    }


    public void setScript(String m_script)
    {
        this.m_script = m_script;
    }


    public String getParameters()
    {
        return m_parameters;
    }


    public void setParameters(String m_parameters)
    {
        this.m_parameters = m_parameters;
    }


    public String getContainsString()
    {
        return m_containsString;
    }


    public void setContainsString(String m_containsString)
    {
        this.m_containsString = m_containsString;
    }


    public String getExpectedExitCode()
    {
        return m_expectedExitCode;
    }


    public void setExpectedExitCode(String m_exitCode)
    {
        this.m_expectedExitCode = m_exitCode;
    }


    public String getOutputString()
    {
        return m_outputString;
    }


    public void setOutputString(String m_outputString)
    {
        this.m_outputString = m_outputString;
    }


    public String getExitCode()
    {
        return m_exitCode;
    }


    public void setExitCode(String m_exitCode)
    {
        this.m_exitCode = m_exitCode;
    }


    public String getErrorString()
    {
        return m_errorString;
    }


    public void setErrorString(String m_errorString)
    {
        this.m_errorString = m_errorString;
    }
        @Override
    public String toString()
    {

        StringBuilder sb = new StringBuilder();

        if (m_script != null && !m_script.equals(
            "")) {
            sb.append("Script:" + m_script + "\n");
        }
        if (m_parameters != null && !m_parameters.equals(
            "")) {
            sb.append("params:" + m_parameters + "\n");
        }
        if (m_expectedExitCode != null && !m_expectedExitCode.equals(
            "")) {
            sb.append("Expected Exit Code:" + m_expectedExitCode + "\n");
        }
        if (m_containsString != null && !m_containsString.equals(
            "")) {
            sb.append("ContainsString:" + m_containsString +
                      "\n");
        }
        if (m_exitCode != null && !m_exitCode.equals(
            "")) {
            sb.append("Exit Code:" + m_exitCode + "\n");
        }
        if (m_outputString != null && !m_outputString.equals(
            "")) {
            sb.append("Output:" + m_outputString + "\n");
        }
        if (m_errorString != null && !m_errorString.equals(
            "")) {
            sb.append("Error Output :" + m_errorString + "\n");
        }


        return sb.toString();
    }
}
